﻿
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0014)about:internet -->
<html>
    <head>
        <meta content="Innovasys Document! X (http://www.innovasys.com)" name=GENERATOR>
        <!--DXMETADATA start type="MetaCharset" --><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><!--DXMETADATA end-->
        <!--DXMETADATA start type="PageItemTitle" format="<title>Overview</title>" --><title>PropExchange Object</title><!--DXMETADATA end-->
        <link href="stylesheets/axstylesheet.css" type=text/css rel=stylesheet>
        <script src="script/ax.js" type=text/javascript>
    </script>

    


<style>
html,div { margin: 0; padding: 0;}

body {
	padding: 0px;
	margin: 0px;
	overflow: auto;
	height: 100%;
}

#winchm_template_button{
	float: right;
	width: 93px;
	top: 7px;
	position: relative;
	text-align: right;
	right: 5px;
	height: auto;
}

#winchm_template_top{
	padding: 0px;
	margin: 0px;
	border-bottom: 1px solid #9B9B9B;
	background-color: #B1CEFE;
}

#winchm_template_navigation{
	margin: 0px;
	padding-top: 7px;
	padding-left: 7px;
	padding-bottom: 3px;
	padding-right: 0px;
	font-size: 8.5pt;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: normal;
	color: #585858;
}

#winchm_template_title{
	margin: 0px;
	padding-top: 4px;
	padding-left: 7px;
	padding-bottom: 7px;
	padding-right: 0px;
	font-size: 18px; 
	font-family: Verdana, Geneva, sans-serif;
	color: #363636;
}

#winchm_template_content{
	margin-top: 20px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	width: auto  !important;
	width: 100%;
}

#winchm_template_footer{
	border-width: 1px;
	border-color: #B1CEFE;
	border-top-style: solid;
	margin-top: 15px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	padding-top: 7px;
	padding-left: 0px;
	padding-bottom: 0px;
	padding-right: 0px;
	font-family: arial, helvetica, sans-serif;
	font-size: 8.5pt;
	color: #696969;
	width: auto;
	text-align: left;
}


#winchm_template_container{
	margin: 0px;
	padding: 0px;
	position: static;
	padding-bottom: 3px;
	overflow: auto;
	background-color: #FFFFFF;
}


@media print
{
#winchm_template_container{
	position: static;	
	margin: 0px;
	padding: 5px;
	
	width: auto;
	height: auto;
	overflow: auto;
}
#winchm_template_button{
visibility:hidden;
}
}

#winchm_template_navigation A:link	{text-decoration: none; color:#004080}
#winchm_template_navigation A:visited  {text-decoration: none; color: #004080}
#winchm_template_navigation A:active {text-decoration: none; color: #004080 }
#winchm_template_navigation A:hover {text-decoration: none;color: #0080FF}

A:link	{text-decoration: underline; color:#0033CC}
A:visited  {text-decoration: underline; color: #0033CC}
A:active {text-decoration: underline; color: #0033CC }
A:hover {text-decoration: underline;color: #FF0000;}
</style>
<script type="text/javascript">
function isMobile(){
Agent = window.navigator.userAgent;
if (Agent.indexOf("iPhone")>=1 || Agent.indexOf("iPad")>=1 || Agent.indexOf("iPod")>=1 || Agent.indexOf("Android")>=1){
return true;
}else{
return false;	
}

}
function d_onresize(){
if (window.navigator.userAgent.indexOf("MSIE")>=1){
document.getElementById('winchm_template_container').style.pixelWidth = document.body.offsetWidth - 3;
document.getElementById('winchm_template_container').style.pixelHeight = document.body.offsetHeight - document.getElementById('winchm_template_top').offsetHeight - 4;
}
document.getElementById('winchm_template_container').style.top = document.getElementById('winchm_template_top').offsetHeight + 'px';
}

function d_onbeforeprint(){
document.getElementById('winchm_template_container').style.width = 'auto';
document.getElementById('winchm_template_container').style.height = 'auto';
}

function d_onafterprint(){
d_onresize();
}

if(!isMobile()){

window.onload = d_onresize;
window.onresize = d_onresize;
window.onbeforeprint = d_onbeforeprint;
window.onafterprint = d_onafterprint;

document.write("<style>\n");
document.write("body {overflow: hidden;}\n");
document.write("#winchm_template_container {position: absolute;overflow: auto;top : 0px;right: 0px;bottom: 0px;left: 0px;}\n");
document.write("</style>\n");
}

</script>
</head>
    <body><script language="JavaScript" type="text/JavaScript">
function syn(){
if(parent.nav.tree){
 if(parent.nav.tree.loaded){
  parent.nav.tree.selectNode(1386);
 }else{
  setTimeout("syn()",500);
}
  }else{
  setTimeout("syn()",500);
  }}
if(parent!=self){
  setTimeout("syn()",100);
}else{
  parent.location.href = "../index.htm?page=XtremeCalendarControl~PropExchange.html";
}
originalOnload = window.onload;
if(originalOnload==null){
window.onload = function(){parent.contentLoaded = true;};
}else{
window.onload = function(){originalOnload();parent.contentLoaded = true;};
}
</script> 


<div id="winchm_template_top">
	<div id="winchm_template_button"><A href="XtremeCalendarControl~PropExchange.html" title="Previous topic"><img id="winchm_template_prev" alt="Previous topic" src="template2/btn_prev_n.gif" border="0"></a><A href="XtremeCalendarControl~PropExchange_members.html" title="Next topic"><img id="winchm_template_next" alt="Next topic" src="template2/btn_next_n.gif" border="0"></a></div>
	<div id="winchm_template_navigation">Help &gt; 
<A href="welcome_screen.htm">Codejock ActiveX Controls v15.3</A> &gt; <A href="XtremeCalendarControl_P.html">Xtreme Calendar</A> &gt; Objects &gt; <A href="XtremeCalendarControl~PropExchange.html">PropExchange Object</A> &gt; </div>
	<div id="winchm_template_title">Overview</div>
</div>
<div id="winchm_template_container">
	<div id="winchm_template_content"><div class=popupbubble id=dxseealsomenu><p id=dxseealsocontent><a href="#Bookmark1387">PropExchange Members</a>
&nbsp;|&nbsp;<a href="#Bookmark1389">CreateAsBinaryFile Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1390">CreateAsRegistry Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1391">CreateAsXML Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1393">ExchangeInt Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1394">ExchangeString Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1395">GetSection Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1396">LoadFromFile Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1397">SaveToFile Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1400">Loading Property</a>
&nbsp;|&nbsp;<a href="#Bookmark1399">Encoding Property</a>
&nbsp;|&nbsp;<a href="#Bookmark1401">Valid Property</a>
&nbsp;|&nbsp;<a href="#Bookmark1402">Value Property</a>
&nbsp;|&nbsp;<a href="#Bookmark638">DoExchangeCfg Method</a>
</p><!--DXMETADATA end --> 
        </div>
        <div id=pagetop>
            <div id=projectnamebanner>
                <table class=projectnametable cellspacing=0>
                    <tbody>
                        <tr>
                            <!--DXMETADATA start type="Literal" condition="childitems:itemtype=seealso" value="<td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td>" --><td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td><!--DXMETADATA end -->
                            <td>
                                <!--DXMETADATA start type="Phrase" Name="Product_Header" -->Xtreme Calendar ActiveX Control v15.3<!--DXMETADATA end --> 
                            </td>
                            <td align=right>
                                <!--DXMETADATA start type="Variable" name="FeedbackLink" format="" --><!--DXMETADATA end -->
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id=pagetitlebanner>
                <h1 class=dxh1>
                <!--DXMETADATA start type="PageItemTitle" -->PropExchange Object<!--DXMETADATA end --></h1>
            </div>
        </div>
        <div id=pagebody valign="bottom">
            <!--DXMETADATA start type="IsNew" format="<script>document.all.pagebody.className = 'newTopic'</script>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Description" source="Item" format="<h4 class=dxh4>$$Description$$</h4><p>%%description%%</p>" --><h4 class=dxh4>Description</h4><p>Object used for reading and writing CommandBar, Docking Pane, Task Panel, Report Control, and Calendar&nbsp;layout information to\from a XML file, the registry, or binary file.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Scrap" name="_MEMBERS_LINK" format="<p>%%scrap%%</p>" --><p>For a list of all members defined in this module, see <a href="#Bookmark1387">PropExchange members</a>.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Diagram" source="item" format="<h4 class=dxh4>$$OBJECT_MODEL$$</h4><p>%%Diagram%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##MODULE_REMARKS" format="<h4 class=dxh4>$$Remarks$$</h4><p>%%comment%%</p>" --><h4 class=dxh4>Remarks</h4><p><P>The <STRONG>PropExchange</STRONG> object provides a universal solution&nbsp;to save the layout and state of the CommandBars, Docking Pane, TaskPanel, and Report Controls to&nbsp;a single&nbsp;file or the system registry&nbsp;with support to write/load directly to/from a&nbsp;file or registry.</P>
<P>&nbsp;</P>
<P>In addition to saving the layout and state of the controls, additional String and Integer values can be saved to the same file using the <A href="#Bookmark1393">ExchangeInt</A> and <A href="#Bookmark1394">ExchangeString</A> methods.&nbsp; It is important to note that both methods require a variable reference to store the data.&nbsp; Note:&nbsp; When working with XML data, there can not be any spaces in the name given to the data.</P>
<P>&nbsp;</P>
<P>More than one layout for each object can be saved to the same file.&nbsp; This allows multiple layouts to be saved to a single location.&nbsp; The <A href="#Bookmark1395">GetSection</A> method will create a new "section" in the file\registry in which a new layout can be saved\loaded.</P>
<P>&nbsp;</P>
<P>There are three ways to save and load layout\state information to a <STRONG>PropExchange</STRONG> object.&nbsp; You can load and save information to the system registry, an XML file, or a binary file.&nbsp; The <A href="#Bookmark1389">CreateAsBinaryFile</A>, <A href="#Bookmark1390">CreateAsRegistry</A>, and <A href="#Bookmark1391">CreateAsXML</A> methods are used to specify whether to save&nbsp;or load the layout\state information and&nbsp;the location of the layout\sate information (path to XML or Bin file, Registry Key).&nbsp; Note this does not actually load\save the information, it just indicates the location to load\save the information to\from and if it will be loaded\saved.</P>
<P>When using any of the <STRONG>CreateAs </STRONG>methods the <STRONG>Loading</STRONG> parameter is used to specify whether the layout information is currently <A href="#Bookmark1400">Loading</A>&nbsp;or saving.&nbsp; The <A href="#Bookmark1400">Loading</A>&nbsp;property will be <STRONG>True</STRONG> until set to <STRONG>False</STRONG> by calling a&nbsp;<STRONG>CreateAs&nbsp;</STRONG>method and passing <STRONG>False</STRONG> as the <STRONG>Loading</STRONG> parameter.&nbsp; The <A href="#Bookmark1400">Loading</A>&nbsp;property can be used to determine if you are currently loading layout information.</P>
<P>The <A href="#Bookmark638">DoExchangeCfg</A> method is used to actually load or save the information to a file or the registry.</P>
<P>When saving information, the <A href="#Bookmark1401">Valid</A> property should be used after a call to one of the <STRONG>CreateAs </STRONG>methods to verify that the layout information was correctly saved to the <STRONG>PropExchange</STRONG> object.</P>
<P>When loading information, the <A href="#Bookmark1396">LoadFromFile</A>&nbsp;method can be used to verify and load the information at the same time.</P>
<P>&nbsp;</P>
<P>The <A href="#Bookmark1399">Encoding</A> property is provided for Unicode support when working with XML files.</P>
<P>&nbsp;</P>
<P>The <A href="#Bookmark1402">Value</A> property is used when working with XML data.&nbsp; The <A href="#Bookmark1402">Value</A>&nbsp;will always contain the layout and state of the control in XML format.&nbsp; The <A href="#Bookmark1402">Value</A>&nbsp;is intended to be used to manually create or get the layout in XML format.&nbsp; This can be used to&nbsp;manually read/write the layout information directly to\from the <A href="#Bookmark1402">Value</A> property if you don't want to&nbsp;save to a file.</P>
<P>&nbsp;</P>
<P>So what layout information is saved?</P>
<P>&nbsp;</P>
<P><STRONG>CommandBars:</STRONG>&nbsp;&nbsp; Toolbar position, theme, any of the options that are displayed in the Customization Dialog, and anything that is specified in the <EM>StateOptions</EM> object.</P>
<P>&nbsp;</P>
<P><STRONG>Report Control:</STRONG>&nbsp; Column order, sort order, group order,&nbsp;column visibility, GroupBox visibility, Column Width, and Alignment.</P>
<P>&nbsp;</P>
<P><STRONG>TaskPanel:</STRONG>&nbsp; Group order, item position and order, expand state of group,&nbsp;item and group state,&nbsp;&nbsp;item and group state captions, item and group state icons, and item and group state order. &nbsp; </P>
<P>&nbsp;</P>
<P><STRONG>Docking Pane:</STRONG>&nbsp; Saves the DockingPaneLayout object.&nbsp; The DockingPaneLayout object contains all panes positions, captions, visibility state, size, group membership&nbsp;if applicable, and&nbsp;icons.</P>
<P>&nbsp;</P>
<P><STRONG>Calendar:</STRONG> Saves data provider and resources configuration which includes <A href="#Bookmark672">CalendarSchedules</A>, <A href="#Bookmark662">CalendarScheduleIDs</A>, <A href="#Bookmark600">CalendarResource</A>, <A href="#Bookmark614">CalendarResourceDescription</A>, <A href="#Bookmark621">CalendarResources</A>, and <A href="#Bookmark158">CalendarDataProvider</A> information.<FONT size=2></P></FONT></p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="ITEM_LIST_WITH_HEADER" namespace="implemented interface" source="Item" filter="" format="<h4 class=dxh4>$$Interfaces$$</h4>%%filtereditemlist%%" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##MODULE_EXAMPLEINTRO" format="<h4 class=dxh4>$$Example$$</h4><p>%%comment%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="INLINE_EXAMPLE" namespace="Example" source="Item" filter="type=inline" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$Example$$</h4>,format= %%%%filtereditemlist%%" --><h4 class=dxh4>Example</h4><DIV Class=LanguageSpecific Name=Example_VB><p><SPAN class="lang">[PropExchange Sample (Visual Basic)]</SPAN>&nbsp;This sample illustrates how to use the ExchangeInt and ExchangeString methods to load and save an Long and String to\from a file.</p><DIV Class=LanguageSpecific Name=Code_VB><TABLE Class="CodeContainerTable" CellPadding="0" CellSpacing="0" Border="0"><TR><TD NOWRAP><CODE Class="VB"><font class='keyword'>Private</font> <font class='keyword'>Sub</font> LoadData()<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> pxRead <font class='keyword'>As</font> <font class='keyword'>New</font> PropExchange<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Specifies to load information from a node named "CustomerInformation"</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;pxRead.CreateAsXML <font class='keyword'>True</font>, <font class='string'>&quot;CustomerInformation&quot;</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Specifies the name of the file to search for the "CustomerInformation"</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'node.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>If</font> pxRead.LoadFromFile(<font class='string'>&quot;c:\test.xml&quot;</font>) <font class='keyword'>Then</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Declares a String object to store information read from the</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'test.xml file.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> StrName <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StrName = <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Searches for a node named "CustomerName", if found, then the information</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'will be stored in the StrName object.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pxRead.ExchangeString <font class='string'>&quot;CustomerName&quot;</font>, StrName, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.<font class='keyword'>Print</font> StrName<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> IntAge <font class='keyword'>As</font> <font class='keyword'>Long</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IntAge = 0<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pxRead.ExchangeInt <font class='string'>&quot;CustomerAge&quot;</font>, IntAge, 0<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.<font class='keyword'>Print</font> IntAge<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>End</font> <font class='keyword'>If</font><BR/>
<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
<BR/>
<font class='keyword'>Private</font> <font class='keyword'>Sub</font> SaveData()<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> pxWrite <font class='keyword'>As</font> <font class='keyword'>New</font> PropExchange<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Specifies that a node named "CustomerInformation" will</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'be created. The XML string is currently stored in</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'the Value property of the pxWrite PropExchange object.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;pxWrite.CreateAsXML <font class='keyword'>False</font>, <font class='string'>&quot;CustomerInformation&quot;</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Verify that the "CustomerInformation" node was successfully</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'written to the object.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>If</font> pxWrite.Valid <font class='keyword'>Then</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Declare a String object to pass in as a reference to the</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'ExchangeString method.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> StrName <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StrName = <font class='string'>&quot;Mr. Smith&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Important - There can be no spaces in the name of the node when using XML</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'This will create a node named "CustomerName" under the "CustomerInformationNode"</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pxWrite.ExchangeString <font class='string'>&quot;CustomerName&quot;</font>, StrName, <font class='string'>&quot;&quot;</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> IntAge <font class='keyword'>As</font> <font class='keyword'>Long</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IntAge = 32<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pxWrite.ExchangeInt <font class='string'>&quot;CustomerAge&quot;</font>, IntAge, 0<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Writes the XML string stored in the Value property to an</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'XML file names test.xml.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pxWrite.SaveToFile <font class='string'>&quot;c:\test.xml&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>End</font> <font class='keyword'>If</font><BR/>
<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
<BR/>
<BR/>
<BR/>
<BR/>
</CODE></TD></TR></TABLE></DIV></DIV>
<DIV Class=LanguageSpecific Name=Example_VB><p><SPAN class="lang">[PropExchange File Sample (Visual Basic)]</SPAN>&nbsp;This sample illustrates how to load and save layout\state information to\from a file.</p><DIV Class=LanguageSpecific Name=Code_VB><TABLE Class="CodeContainerTable" CellPadding="0" CellSpacing="0" Border="0"><TR><TD NOWRAP><CODE Class="VB"><font class='keyword'>Sub</font> ExchangeState(px <font class='keyword'>As</font> PropExchange)<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>On</font> <font class='keyword'>Error</font> <font class='keyword'>Goto</font> <font class='keyword'>Error</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'PropExchange object to save and load information</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'to\from.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> pxSection <font class='keyword'>As</font> PropExchange<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> Options <font class='keyword'>As</font> StateOptions<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> Options = CommandBars.CreateStateOptions<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Options.SerializeControls = <font class='keyword'>True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Options.SaveOnlyCustomized = <font class='keyword'>True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Options.SaveOriginalControls = <font class='keyword'>False</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Options.SerializeOptions = <font class='keyword'>True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Options.SerializeLayout = <font class='keyword'>True</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Creates a section called "CommandBars" if saving or</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'retieves data from the "CommandBars" node of loading.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> pxSection = px.GetSection(<font class='string'>&quot;CommandBars&quot;</font>)<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Loads or Saves the settings of the StateOptions object</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Note: The StateOptions specify what to save or load of</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'the commandbars layout\state.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.DoPropExchange pxSection, Options<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font color='keyword'>Error</font>:<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
<BR/>
<font class='keyword'>Private</font> <font class='keyword'>Sub</font> Form_Load()<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Loads the CommandBars from Designer Data. This data was added by</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'specifying an .xcb file when right-clicking the CommandBar object</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'and selecting "Load CommandBars(*.xcb).</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.LoadDesignerBars<BR/>
<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
<BR/>
<font class='keyword'>Private</font> <font class='keyword'>Sub</font> LoadData()<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> pxRead <font class='keyword'>As</font> <font class='keyword'>New</font> PropExchange<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Load data from a binary file</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If (pxRead.CreateAsBinaryFile(True, "c:\file.out")) Then</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>' ExchangeState pxRead</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'End If</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Load data from a xml file</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;pxRead.CreateAsXML <font class='keyword'>True</font>, <font class='string'>&quot;Settings&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>If</font> pxRead.LoadFromFile(<font class='string'>&quot;c:\file.xml&quot;</font>) <font class='keyword'>Then</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExchangeState pxRead<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>End</font> <font class='keyword'>If</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Load data from a binary file</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'pxRead.CreateAsRegistry True, "HKEY_CURRENT_USER\Software\Codejock Software\Project1\Sample"</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'ExchangeState pxRead</font><BR/>
<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
<BR/>
<font class='keyword'>Private</font> <font class='keyword'>Sub</font> SaveData()<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> pxWrite <font class='keyword'>As</font> <font class='keyword'>New</font> PropExchange<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Save data to a binary file</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'pxWrite.CreateAsBinaryFile False, "c:\file.out"</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'ExchangeState pxWrite</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Save data to a xml file</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;pxWrite.CreateAsXML <font class='keyword'>False</font>, <font class='string'>&quot;Settings&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>If</font> pxWrite.Valid <font class='keyword'>Then</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExchangeState pxWrite<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pxWrite.SaveToFile <font class='string'>&quot;c:\file.xml&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>End</font> <font class='keyword'>If</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Save data to the registry</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'pxWrite.CreateAsRegistry False, "HKEY_CURRENT_USER\Software\Codejock Software\Project1\Sample"</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'ExchangeState pxWrite</font><BR/>
<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
</CODE></TD></TR></TABLE></DIV></DIV>
<!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="seealso" source="Item" filter="" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$See_Also$$</h4><p id=dxseealsocontent>%%filtereditemlist%%</p>" --><h4 class=dxh4>See Also</h4><p id=dxseealsocontent><a href="#Bookmark1387">PropExchange Members</a>
&nbsp;|&nbsp;<a href="#Bookmark1389">CreateAsBinaryFile Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1390">CreateAsRegistry Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1391">CreateAsXML Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1393">ExchangeInt Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1394">ExchangeString Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1395">GetSection Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1396">LoadFromFile Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1397">SaveToFile Method</a>
&nbsp;|&nbsp;<a href="#Bookmark1400">Loading Property</a>
&nbsp;|&nbsp;<a href="#Bookmark1399">Encoding Property</a>
&nbsp;|&nbsp;<a href="#Bookmark1401">Valid Property</a>
&nbsp;|&nbsp;<a href="#Bookmark1402">Value Property</a>
&nbsp;|&nbsp;<a href="#Bookmark638">DoExchangeCfg Method</a>
</p><!--DXMETADATA end --><!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="example" source="Item" filter="type=linked" NoHeader="True" NoFooter="True" format="><!--DXMETADATA end --><!--DXMETADATA start type="Variable" name="CopyrightNotice" format="><!--DXMETADATA end --></div></div>	
	<div id="winchm_template_footer">Copyright &copy; 2018. All rights 
reserved. (To change the copyright info, just edit it in template.)</div>
</div>

</body>
</html>

